//
//  UIView+push.m
//  WeiNingProject
//
//  Created by wnsj on 2020/3/11.
//  Copyright © 2020 卫宁数据. All rights reserved.
//

#import "UIView+push.h"


@implementation UIView (push)


-(UIViewController *)viewController {

    for (UIView *next = [self superview]; next; next = next.superview) {
        UIResponder *nextResponder = [next nextResponder];
        if ([nextResponder isKindOfClass:[UIViewController class]]) {
            return (UIViewController *)nextResponder;
        }
    }

    return nil;
}




@end
